<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>东家帮-订单详情</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">
	<meta name="format-detection" content="telephone=no">
	<meta name="renderer" content="webkit">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="stylesheet" href="${base}/css/common.css"/>
	<link rel="stylesheet" href="${base}/css/index2.css"/>
	<base href="${base}/index/">
	<style type="text/css">
		.pic { background: none;margin-top: 5px;width: 30%;margin-left: 0px;max-width: 128px;}
		.small{    width: 30%;max-width: 148px;    height: 80px;}
	</style>
</head>
<body>
<div class="houseList orderList detail">
	<form action="${base}/index/orderSave" id="loginform" name="loginform" method="post">
	<div class="one" >
		<div class="line"><div class="title" >订单中心</div></div> 
		<div class="line" style="margin-top: 6px;padding-bottom: 6px;">
			<div class="label" style="width: 35%;">订单编号:</div><div class="value">${orderid}</div>
			<div class="label" style="width: 35%;" >开始服务时间:</div><div class="value">${checkouttime1}</div>
			<div class="label" style="width: 35%;">最迟完成时间:</div><div class="value">${endtime1}</div>
			<div class="label" style="width: 35%;">订单状态:</div><div class="value">${statusname}</div>
			<div class="label" style="width: 35%;">订单金额:</div><div class="value">${money}</div>
		</div>
	</div>
	<#if sid gt 0 >
	<div class="one" >
		<div class="line"><div class="title" >服务人员信息</div></div>
		<div class="line" style="margin-top: 6px;padding-bottom: 6px;float: left; width: 130px;">
			<img alt="服务人员" src="${shead?default(base+'/images/head.png') }" width="120" height="120" />
		</div>
		<div class="line" style="margin-top: 6px;padding-bottom: 6px;float: left; width: auto;min-width: 220px; padding-top: 20px;">
			<div class="label">姓名:</div><div class="value">${sname}</div>
			<div class="label">工号:</div><div class="value">${saccount}</div>
			<div class="label">星级:</div><div class="value"><img src="${base}/images/star.png" width = "14" height = "14"/><img src="${base}/images/star.png" width = "14" height = "14"/><img src="${base}/images/star.png" width = "14" height = "14"/><img src="${base}/images/star.png" width = "14" height = "14"/><img src="${base}/images/star.png" width = "14" height = "14"/></div>
		</div>
	</div>
	</#if>
	<div class="one" >
		<div class="line"><div class="title" >服务内容</div></div> 
		<div class="line"><div class="label" >基础服务</div></div>
		<#list options as one>
		<div class="line"><div class="label" style="width: 100%;" >${one_index+1}、${one}</div></div>
		</#list>
		<div class="line"><div class="title" >布草:${linen}</div></div>
		<div class="line"><div class="title" style="color: #666;font-size: 15px;">1.5米床用${five}套</div></div>
		<div class="line"><div class="title" style="color: #666;font-size: 15px;">1.8米床用${eight}套</div></div>
		
		 
	</div>
	<#if fid gt 0 >
	<div class="one" >
		<div class="line"><div class="title" >集散地信息</div></div>
		<div class="line" style="margin-top: 6px;padding-bottom: 6px;">
			<div class="label">名称:</div><div class="value">${fname}</div>
			<div class="label">地址:</div><div class="value">${faddress}</div>
		</div>
	</div>
	</#if>
	<#if status == 2 &&  sessiontype == 1>
		<div class="one" >
		<div class="line"><div class="title" >未打扫照片</div></div>
		<div class="line">
<!-- 			<input name="bpic" type="hidden" id="bpic" value="${bpic?if_exists}"  > -->
			<input name="bpic1" type="hidden" id="bpic1val" value=""  />
			<input name="bpic2" type="hidden" id="bpic2val" value=""  />
			<input name="bpic3" type="hidden" id="bpic3val" value=""  />
			<input name="bpic4" type="hidden" id="bpic4val" value=""  />
			<input name="bpic5" type="hidden" id="bpic5val" value=""  />
			<input name="bpic6" type="hidden" id="bpic6val" value=""  />
		<img id="bpic1" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic bpic" />
		<img id="bpic2" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic bpic" />
		<img id="bpic3" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic bpic" />
		<img id="bpic4" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic bpic" />
		<img id="bpic5" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic bpic" />
		<img id="bpic6" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic bpic" />
		</div>
	</div>
	</#if>
	<#if bpicsize gt 0 >
	<div class="one" >
		<div class="line"><div class="title" >未打扫照片</div></div>
		<div class="line">
		<#list bpicArray as one>
		<img src="${one}" class="small"/>
		</#list>
		</div>
	</div>
	</#if>
	
	<#if status == 3 &&  sessiontype == 1>
		<div class="one" >
		<div class="line"><div class="title" >打扫后照片</div></div>
		<div class="line">
<!-- 			<input name="bpic" type="hidden" id="bpic" value="${apic?if_exists}"  > -->
			<input name="apic1" type="hidden" id="apic1val" value=""  />
			<input name="apic2" type="hidden" id="apic2val" value=""  />
			<input name="apic3" type="hidden" id="apic3val" value=""  />
			<input name="apic4" type="hidden" id="apic4val" value=""  />
			<input name="apic5" type="hidden" id="apic5val" value=""  />
			<input name="apic6" type="hidden" id="apic6val" value=""  />
		<img id="apic1" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic apic" />
		<img id="apic2" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic apic" />
		<img id="apic3" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic apic" />
		<img id="apic4" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic apic" />
		<img id="apic5" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic apic" />
		<img id="apic6" src="${base+'/images/uploadimg.png'}" alt="点击上传照片" class="pic apic" />
		</div>
	</div>
	</#if>
	<#if apicsize gt 0 >
	<div class="one" >
		<div class="line"><div class="title" >打扫后照片</div></div>
		<div class="line">
		<#list apicArray as one>
		<img src="${one}" class="small"/>
		</#list>
		</div>
	</div>
	</#if>
	<div class="one" >
		<div class="line"><div class="title" >房屋信息</div></div> 
		<div class="line"><div class="value" >${house.name}</div></div>
		<div class="line"><div class="value"><img src="${base}/images/area.png" width="14" height="12"> ${house.area} ㎡</div></div>
		<div class="line"><div class="value"><img src="${base}/images/addr.png" width="14" height="12"> ${house.address}</div></div>
	</div>
	<#if goodssize gt 0 >
	<div class="one" >
		<div class="line"><div class="title" >房内照片</div></div>
		<div class="line">
		<#list goodsArray as one>
		<img src="${one}" class="small"/>
		</#list>
		</div>
	</div>
	</#if>  
	<div class="one hide" >
		<div class="line"><div class="title" >租客信息</div></div> 
		<div class="line"><div class="label" >租客姓名:</div><div class="value"> ${rentername} </div></div>
		<div class="line"><div class="label" >联系电话:</div><div class="value"> ${rentermobile}</div></div>
		<div class="line"><div class="label" >备注</div><div class="value"> ${note}</div></div> 
	</div>
	<#if sessiontype == 1 && status gt 0 && status lt 4>
	<div class="one">
		<div class="line">
			<input type="button" id="submit"  onclick="save();" value="确定" class="btn" style="width: 90%; height: 36px;color: #fff;text-align: center;font-size: 16px;float: left;border-radius:10px;" />
		</div>
	</div>
	</#if>  
	</form>
</div>
</body>
<form action="${base}/util/uploadFile" method="post" name="uploadForm" enctype="multipart/form-data" id="uploadForm" class="hide" >
    <input name="pic" type="file" id="pic" class="hide"/>
</form>
<script type="text/javascript" src="${base}/js/common.js"></script>
<script src="${base}/js/jquery1.10.2.min.js" ></script>
<script src="${base}/js/jquery.form.js" ></script>
<script>
var currentPic;
jQuery(function(){
	 // 文件上传
    $(".pic").click(function(){
        currentPic = $(this)
        $("#pic").click();
    });
    $("#pic").change(function (){
        var fileName = $("#pic").val()
        var options = {
            success:  showResponse,  //处理完成的回调函数
            resetForm: true,
            //dataType:  'json'
        };
        $("#uploadForm").ajaxSubmit(options);
    });
});

function save(){
	<#if status == 1>
		$.ajax({ 
			url: "orderSave?id=${id}",
			type:"POST",
			success: function(data){
				alert(data);
				window.location.reload();
		    }
		});
	</#if>
	<#if status == 2>
	var bpic = "";
	for(var i = 1 ;i < 7;i++){
		var picval = $("#bpic"+i+"val").val() 
		if (picval){
			bpic = bpic +picval +","
		}
	}
	if(bpic.length > 0 ){
		bpic = bpic.substring(0, bpic.length-1);
		$.ajax({ 
			url: "orderSave?id=${id}",
			type:"POST",
			data:{"bpic":bpic},
			success: function(data){
				alert(data);
				window.location.reload();
		    }
		});
	} else {
		alert("沒有上传图片");
	}
	</#if>
	<#if status == 3>
	var apic = "";
	for(var i = 1 ;i < 7;i++){
		var picval = $("#apic"+i+"val").val() 
		if (picval){
			apic = apic +picval +","
		}
	}
	if(apic.length > 0 ){
		apic = apic.substring(0, apic.length-1);
		$.ajax({ 
			url: "orderSave?id=${id}",
			type:"POST",
			data:{"apic":apic},
			success: function(data){
				alert(data);
				window.location.reload();
		    }
		});
	} else {
		alert("沒有上传图片");
	}
	</#if>
}

function showResponse(responseText)  {
	$("#"+currentPic.attr("id")+"val").val(responseText);
	currentPic.attr("src", responseText)
}
</script>
</html>